package com.example.design.patterns.冰河.行为模式.解析器模式;

import com.example.design.patterns.冰河.行为模式.解析器模式.abstractExpression.Expression;
import com.example.design.patterns.冰河.行为模式.解析器模式.context.Context;
import com.example.design.patterns.冰河.行为模式.解析器模式.expression.AdvanceExpression;
import com.example.design.patterns.冰河.行为模式.解析器模式.expression.SimpleExpression;

public class Test {
    public static void main(String[] args) {
        Context ctx = new Context();
        ctx.add(new SimpleExpression());
        ctx.add(new AdvanceExpression());
        ctx.add(new SimpleExpression());
        for (Expression expression : ctx.getList()) {
            expression.interpret(ctx);
        }
    }
}
